package common

import widgetcommon "clientDemo/ui/fyne_ui/widget/interface"

var _s *SkinManager

type SkinManager struct {
	widgetInfos map[string]widgetcommon.IWidgetSkin
}

func Get() *SkinManager {
	if _s != nil {
		return _s
	}
	o := &SkinManager{
		widgetInfos: make(map[string]widgetcommon.IWidgetSkin),
	}
	_s = o
	return o
}
func (s *SkinManager) AddSkin(skinName string, skinInfo widgetcommon.IWidgetSkin) {
	s.widgetInfos[skinName] = skinInfo
}
func (s *SkinManager) GetSkin(skinName string) widgetcommon.IWidgetSkin {
	return s.widgetInfos[skinName]
}

// GetAllSkins 获取所有皮肤信息
func (s *SkinManager) GetAllSkins() map[string]widgetcommon.IWidgetSkin {
	return s.widgetInfos
}
